clear all

use waves_policy_combined_season.dta, replace

***Drop missing values***
drop if utility_type==.
drop if disconnected==.
drop if forego_expenses==.
drop if energy_assistance==.

**Encode respondent ID's**
destring caseid_w1, generate(id)
encode utility, generate(utility2)

svyset id [pweight=weight]

sort id wave
xtset id wave
xtdescribe

**Clean variables**
recode gender (2=0)
gen female=0
replace female=1 if gender==0

recode hh_under5 (2=1) (3=1) (4=1)

drop iou muni coop
gen muni=0
replace muni=1 if utility_type==1
gen iou=0
replace iou=1 if utility_type==2
gen coop=0
replace coop=1 if utility_type==3

label define wave_label  1 "Wave 1" 2 "Wave 2" 3 "Wave 3" 4 "Wave 4"
label val wave wave_label


**Generate lags**
gen wap_liheap=0
replace wap_liheap=1 if wap==1 | liheap==1

sort wave id
by wave: gen wapliheap_lag1=wap_liheap[_n-1]

replace stimulus=0 if stimulus==.

sort wave id
by wave: gen stimulus_lag1=stimulus[_n-1]

gen other_assistance=0
replace other_assistance=1 if snap==1 | tanf==1 | medicaid==1 | vet_benefits==1 | unemp_insurance==1

sort wave id
by wave: gen otherassistance_lag1=other_assistance[_n-1]


set scheme s2color

xi i.state
xi i.wave
xi i.utility

*****PAPER MODEL GLOBALS*****
global days_mandatory dayscovered_moratorium wapliheap_lag1 otherassistance_lag1 black hispanic unemployed educ under_100_fpl hh_under5 hhsize ownhome hh_over65 iou coop i.wave i.state

global days_covered dayscovered_total wapliheap_lag1 otherassistance_lag1 black hispanic unemployed educ under_100_fpl hh_under5 hhsize ownhome hh_over65 iou coop i.wave i.state



**Table S10 Column 3**
reg disconnected $days_covered [pweight=weight]
outreg2 using tableS10.rtf, keep($days_covered) stats(coef se) alpha(0.01, 0.05, 0.1) dec(3) pdec(3) append

**Table S10 Column 6**
reg forego_expenses $days_covered [pweight=weight]
outreg2 using tableS10.rtf, keep($days_covered) stats(coef se) alpha(0.01, 0.05, 0.1) dec(3) pdec(3) append

**Table S10 Column 9**
reg energy_assistance $days_covered [pweight=weight]
outreg2 using tableS10.rtf, keep($days_covered) stats(coef se) alpha(0.01, 0.05, 0.1) dec(3) pdec(3) append